package ink.metoo.gude.module.websocket.domain.vo

import ink.metoo.gude.module.websocket.domain.PublicMessageBody
import ink.metoo.gude.module.websocket.domain.ToPublicType
import ink.metoo.gude.module.websocket.domain.ddl.Message
import java.util.*

class PublicMessageVO : PublicMessageBody(ToPublicType.USER_MESSAGE) {

    var mid: Long? = null

    var content: Map<String, Any>? = null

    var creator: String? = null

    var creatorName: String? = null

    var creatorEmail: String? = null

    var createDate: Date? = null

    var createAvatar: String? = null


    fun fromMessage(msg: Message) {
        this.mid = msg.id
        this.creator = msg.creator?.account
        this.creatorName = msg.creator?.nickname
        this.creatorEmail = msg.creator?.email
        this.createDate = msg.createDate
        this.createAvatar = msg.creator?.avatar
    }


}
